﻿using System;
using System.Windows;
using System.Windows.Controls;

namespace FazaDemo.PL.Wpf
{
    class ContentEventBuildWorker : VisualBuildWorker
    {

        private readonly string _content;

        private readonly string _name;

        private readonly RoutedEventHandler _clickHandler;

        public ContentEventBuildWorker(string content, string name, RoutedEventHandler clickHandler)
        {
            _content = content;
            _name = name;
            _clickHandler = clickHandler;
        }

        protected override void FactoryInit()
        {
            if (_type == typeof(Button))
            {
                _factory = new ButtonFactory(_content, _name, _clickHandler);
            }
        }
    }
}